<?php

namespace App\Http\Requests\Api\v1;

use App\Models\Configuration;

class WithdrawalRequest extends FormRequest
{

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules(): array
    {
        switch ($this->method()) {
            case 'POST':
                return [
                    'payment_password' => 'required|digits:6',
                    'amount' => 'required|numeric|int|gt:0',
                    'card_id' => 'required|numeric|int|gt:0|exists:App\Models\Card,id',
                ];
            case 'GET':
                return [
                    'page' => 'numeric|min:1',
                    'limit' => 'numeric|min:1'
                    //'date' => 'date|after:2019-12-01|before:tomorrow',
                ];
        }
    }

}
